package o;

import android.content.Context;
import android.graphics.drawable.ClipDrawable;
import android.graphics.drawable.Drawable;
import android.graphics.drawable.GradientDrawable;
import android.graphics.drawable.LayerDrawable;
import o.ewm.d;
import o.ewm.e;

public class dke extends ckd {
    public dke(Context context, int i, int i2) {
        Drawable ॱ = epo.ॱ(context.getResources().getDrawable(e.ˉ), i);
        int ˊ = erq.ˊ(i2, 0.5f);
        ॱ().ˊ(ˊ(ॱ));
        ॱ().ˎ(ˊ);
        ˋ().ˊ(ˏ(context, erq.ˊ(i, 0.4f), erq.ˊ(i, 0.4f), 0));
        ˋ().ˎ(i2);
        ˊ().ˊ(ˊ(ॱ));
        ˊ().ˎ(i2);
        ˏ().ˊ(ˊ(ॱ));
        ˏ().ˎ(ˊ);
    }

    private Drawable ˊ(Drawable drawable) {
        if (drawable == null || drawable.getConstantState() == null) {
            return drawable;
        }
        return drawable.getConstantState().newDrawable().mutate();
    }

    public dke(Context context, int i, int i2, int i3, boolean z, int i4) {
        ˊ(context, i, i2, context.getResources().getDrawable(i3), z, i4);
    }

    public dke(Context context, int i, int i2, Drawable drawable, boolean z, int i3) {
        ˊ(context, i, i2, drawable, z, i3);
    }

    private void ˊ(Context context, int i, int i2, Drawable drawable, boolean z, int i3) {
        if (z) {
            drawable = epo.ॱ(drawable, i);
        }
        Drawable ˊ = ˊ(drawable);
        int ˊ2 = erq.ˊ(i2, 0.3f);
        ॱ().ˊ(ˊ);
        ॱ().ˎ(ˊ2);
        ˋ().ˊ(ˏ(context, erq.ˊ(i, 0.4f), erq.ˊ(i, 0.4f), i3));
        ˋ().ˎ(i2);
        ˊ().ˊ(drawable);
        ˊ().ˎ(i2);
        ˏ().ˊ(ˊ(drawable));
        ˏ().ˎ(ˊ2);
    }

    protected Drawable ˏ(Context context, int i, int i2, int i3) {
        Drawable[] drawableArr = new Drawable[2];
        LayerDrawable layerDrawable = (LayerDrawable) context.getResources().getDrawable(e.ᐝॱ);
        GradientDrawable gradientDrawable = (GradientDrawable) layerDrawable.findDrawableByLayerId(16908288);
        if (gradientDrawable == null) {
            return null;
        }
        if (i3 != 0) {
            gradientDrawable.setColor(i3);
        }
        gradientDrawable.setStroke(context.getResources().getDimensionPixelOffset(d.ʽˊ), i);
        GradientDrawable gradientDrawable2 = (GradientDrawable) layerDrawable.findDrawableByLayerId(16908301);
        if (gradientDrawable2 == null) {
            return null;
        }
        gradientDrawable2.setColor(i2);
        int i4 = 3;
        if (MinimumFactory.getBoolValue(context)) {
            i4 = 5;
        }
        ClipDrawable clipDrawable = new ClipDrawable(gradientDrawable2, i4, 1);
        drawableArr[0] = gradientDrawable;
        drawableArr[1] = clipDrawable;
        Drawable layerDrawable2 = new LayerDrawable(drawableArr);
        layerDrawable2.setId(0, 16908288);
        layerDrawable2.setId(1, 16908301);
        return layerDrawable2;
    }
}
